# -*- coding:utf-8 -*-

# -*- coding: utf-8 -*-
# coding:unicode_escape
from asyncio import sleep
import sys, os, time
from PySide6 import QtCore, QtWidgets, QtGui, QtStateMachine


class Example(QtWidgets.QWidget):

    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        self.button = QtWidgets.QPushButton("Start", self)
        self.button.clicked.connect(self.doAnim)
        self.button.move(30, 30)

        self.frame = QtWidgets.QFrame(self)
        self.frame.setFrameStyle(QtWidgets.QFrame.Panel | QtWidgets.QFrame.Raised)
        self.frame.setGeometry(150, 30, 100, 100)

        self.setGeometry(300, 300, 380, 300)
        self.setWindowTitle('Animation')
        self.show()

    def doAnim(self):
        self.anim = QtCore.QPropertyAnimation(self.frame, b"geometry")
        self.anim.setDuration(10000)
        self.anim.setStartValue(QtCore.QRect(150, 30, 100, 100))
        self.anim.setEndValue(QtCore.QRect(150, 30, 200, 200))
        self.anim.start()


if __name__ == "__main__":
    app = QtWidgets.QApplication([])
    ex = Example()
    ex.show()
    app.exec_()

